package com.zrwl.poscloud.xo.mapper;

import com.zrwl.poscloud.base.entity.Sequence;
import com.zrwl.poscloud.base.superI.SuperMapper;
import com.zrwl.poscloud.xo.vo.SequenceVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 黑名单序号 Mapper类
 *
 * @author 刘思童 AutoGenerate
 * @date 2021-07-12
 */
public interface SequenceMapper extends SuperMapper<Sequence> {
    @Select("<script>" +
            "  SELECT a.* FROM t_sequence a " +
            "  WHERE a.code_type=#{param.codeType} AND a.owner_type=#{param.ownerType} " +
            " <if test='param.ownerUid!=null and param.keyword!=&quot;&quot;'> " +
            "  AND a.owner_uid=#{param.ownerUid} " +
            " </if> " +
            " <if test='param.ownerUid==null'> " +
            "  AND ISNULL(a.owner_uid) " +
            " </if> " +
            "  for update " +
            "</script>"
    )
    public Sequence getAssignSequence(@Param("param") SequenceVO sequenceVO);
}
